import {defineStore} from "pinia";
import {ref} from "vue";
//组合式
export const useUserInfoStore = defineStore('userInfo',() => {
      const info = ref({})
      const setInfo = (newUserInfo) => {
        // console.log('useUserInfoStore::newUserInfo@@@@',newUserInfo)
        info.value = newUserInfo
      }
      const removeInfo = () => {
        info.value = {}
      }

      return {
        info, setInfo, removeInfo
      }
    },
    {
      persist: {
        enabled: true,
        strategies: [
          {
            key: 'userInfo',
            storage: localStorage
          }
        ]
      }
    });